#ifndef _GLWIDGET_H
#define _GLWIDGET_H

#include <QtOpenGL/QGLWidget>
#include "../geometry/polygon.h"
#include "paintdata.h"

class GLDrawer : public QGLWidget
{
    Q_OBJECT

public:
    GLDrawer(paint_data_t * data, QWidget * parent = NULL);

protected:
    void initializeGL();
    void resizeGL(int w, int h);
    void paintGL();
    void mousePressEvent(QMouseEvent *event);
    void mouseMoveEvent(QMouseEvent *event);
    void keyPressEvent(QKeyEvent *event);

private:
    paint_data_t * data_;
    void paintPolygon();
    void paintRay();
    void paintGrid();
    void paintRasterization();
};

#endif
